package com.endpoint.book.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.endpoint.book.entity.Book;
import com.endpoint.book.mapper.BookMapper;
import com.endpoint.book.service.IBookService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 小说表 服务实现类
 * </p>
 *
 * @author cr
 * @since 2022-10-21
 */
@Service
public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements IBookService {

    @Override
    public List<Book> updateRankList() {
        QueryWrapper<Book> wrapper = new QueryWrapper<>();
        //根据最后更新时间降序排序
        wrapper.orderByDesc("last_index_update_time");
        List<Book> books = this.baseMapper.selectList(wrapper);
        return  books;
    }
}
